Skip to content

Whit 2073 access limit documents to named editors#11448

Draft
jamiestamp wants to merge 6 commits into
mainfrom
WHIT-2073-access-limit-documents-to-named-editors
Draft

Whit 2073 access limit documents to named editors#11448
jamiestamp wants to merge 6 commits into
mainfrom
WHIT-2073-access-limit-documents-to-named-editors

Conversation

@jamiestamp
Copy link
Copy Markdown
Contributor

Adds the "Limit access to named publishers" option to the access limiting form. Publishers can now restrict access to a draft to a list of email addresses, with the creating publisher always preserved on the list.

Edition::LimitedAccess manages the list via the named_accesses association with autosave: assigning access_limited_named_users= and marks-for-destruction records eagerly so the persisted list always matches the input. EditionRules#access_limit_enforced? and Admin::EditionFilter are extended to enforce membership for the named_users mode, and DraftEditionUpdater skips its organisation-membership check for it.

@jamiestamp jamiestamp force-pushed the WHIT-2073-access-limit-documents-to-named-editors branch from e41d3c6 to 2c38d60 Compare May 14, 2026 14:19
jamiestamp and others added 5 commits May 21, 2026 12:22
As a boolean in MySQL is set up as a tinyint(1), we can set up the new options to extend what was already there.

-------------------------------------
| DB    | Before    | After         |
| Value | migration | migration     |
|-----------------------------------|
| 0     | False     | disabled      |
| 1     | True      | organisations |
| 2     |           | named_users   |
-------------------------------------

Taking this approach means we maintain the correct options when converting the column.

Updates any references to the old values to `disabled` and `organisations` as needed.
Introduces the `EditionUserAccess` model and corresponding migration to manage user access per edition. Ensures email presence, uniqueness within an edition, and valid email format.
@GDSNewt GDSNewt force-pushed the WHIT-2073-access-limit-documents-to-named-editors branch 2 times, most recently from 73d7343 to 363294b Compare May 21, 2026 15:15
@GDSNewt GDSNewt force-pushed the WHIT-2073-access-limit-documents-to-named-editors branch from 363294b to 0ed3d6d Compare May 22, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants